<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<jsp:include page="/common.jsp"></jsp:include>
<script type="text/javascript">
Ext.onReady(function () {

    var data = [[1, "张三"], [2, "李四"], [3, "王五"], [4, "李龙"], [5, "天哥"], [6, "随影"]];

    var proxy = new Ext.data.MemoryProxy(data);

    var columnName = new Ext.data.Record.create([
   { name: "id", type: "int" },
   { name: "name", type: "string" }
   ]);

    var reader = new Ext.data.ArrayReader({}, columnName);

    var store = new Ext.data.Store({
        proxy: proxy,
        reader: reader,
        autoLoad: true
    });
    store.load();

    //设置默认值
    store.on('load', function () {
        //taskstatuscombo.selectAll(); //全选
        taskstatuscombo.setValue("王五"); //默认选中王五
    });

    var taskstatuscombo = new Ext.form.MultiSelect({
        renderTo: Ext.getBody(),
        width: 200,
        editable: false,
        store: store,
        valueField: 'name',
        displayField: "name",
        mode: 'local',
        triggerAction: 'all',
        allowBlank: false,
        emptyText: '请选择',
        maxHeight: 200 //下拉框的最大高度
    });
});
</script>
</head>
<body>
<div id="local-states"></div>
</body>
</html>